This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Fix order status handling #75
Merged
gdespirito
merged 6 commits into
TransbankDevelopers:master
from
mgiadach:fix/setting-order-status
Apr 22, 2020
Merged
Fix order status handling #75
gdespirito
merged 6 commits into
TransbankDevelopers:master
from
mgiadach:fix/setting-order-status
Apr 22, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for your contribution 🎉 |
barbazul
suggested changes
Apr 21, 2020
@@ -152,7 +151,7 @@ protected function getOrder() | |||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |||
|
|||
return $objectManager->create('\Magento\Sales\Model\Order')->load($orderId); | |||
} catch (Exception $e) { | |||
} catch (\Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aquí claramente se está arreglando un bug de namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
gdespirito
suggested changes
Apr 22, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tested and everything works as expected, but @barbazul discovered a bug in the code. Can you solve this to approve the PR? Thanks again!
gdespirito
reviewed
Apr 22, 2020
gdespirito
approved these changes
Apr 22, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main purpose of this fix is to actually use the "Estado de Nueva Orden" defined by the admin in the module config. Previously, Magento's default status was used (
pending
) and there was no way to use the value from the config.Also, I did some refactoring regarding status to make the code more readable and added a double status check before cancelling an order (this prevents a cancellation to happen if multiple requests from Trabsbank are received when the order is already paid).